JBoss Community Archive (Read Only)

Graphene 1

Creating Custom Retrievers

To implement our own Retriever, we must create class implementing at least one of the interfaces SeleniumRetriever<T> or JavaScriptRetriever<T>.

As names suggest, we will need to call the selenium here (in SeleniumRetrieve<T>#retrieve() body) or specify JavaScript object (in JavaScriptRetriever<T>#getJavaScriptRetrieve()), which will after evaluation result into given value.

However in case of JavaScriptRetriever, we need to additionaly specify the Convertor implementation, which will convert the value from String representation before returning from waitForChangeAndReturn method.

We can also implement both the interfaces for selenium and ajax retrieving - it will then depend on implementation of Waiting object used in condition, what retriever will be used:

TextRetriever  retrieveCount = retrieveText.locator(TEXT_COUNT);
waitAjax().waitForChange("1", retrieveCount);
waitSelenium().waitForChange("2", retrieveCount);
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 12:13:26 UTC, last content change 2011-09-01 11:46:08 UTC.